package testAccident;

import static org.junit.Assert.*;

import org.junit.*;
import java.io.*;

import junit.framework.TestCase;

import accident.*;
import player.*;


public class testAccidentWindow extends TestCase {	
	@Test
	public void testAccidentWindow_1() {
		String expected;
		String greet1="You just stepped on the Accident cell";
		String greet2="5 SE points will be subtracted";
		String greet3="Your SE points have been deducted";
		String greet4="SE Points Changed!";
		String greet5="Player 1\tRole: Grandmother";
		
		String SE="Player 1 right now has 10 SE Points";
		String mc="Player 1 now has 1 magic card";
		String mc1="escapeHospital";
		String end="Accident Stop here.";
		String end2="**************************************";
		
		
		ByteArrayOutputStream testOut = new ByteArrayOutputStream();
		PrintStream testOutPrintStream = new PrintStream(testOut);
		System.setOut(testOutPrintStream);
		
		Player p = new Player();
		AccidentWindow ac = new AccidentWindow(p);
		p.setPlayerID(1);
		p.setRole("Grandmother");
		p.setSEPoint(15);
		ac.greet();

		String newLine = System.getProperty("line.separator");
		if (newLine == null) newLine = "\n";
		expected = greet1+newLine+greet2+newLine+greet3+newLine+newLine+greet4+newLine+greet5+newLine+
		SE+newLine+mc+newLine+mc1+newLine+newLine+end+newLine+end2+newLine;
		
		assertEquals(expected, testOut.toString());
	}
}
